/**
 * Created by wchuang on 2017/2/23.
 */

var imPageUrl = './im-page.html';

document.write("<div id='showChatItem' style='font-family: Microsoft YaHei ;width:60px; height: 100px;background: #56d0ca;position: fixed;top: 55%;margin-top: -40px;right: -6px;border-radius: 5px;z-index: 999;font-size: 20px;line-height: 100px;text-align: center;color:#ffffff;cursor: pointer;'>客服 </div>");

document.write("<script language='javascript' src='./dist/js/jquery-2.2.3.min.js'></script>");
document.write("<script language='javascript' src='./dist/js/layer.js'></script>");

window.onload=function(){
    showChat();

    //点击弹窗
    $('#showChatItem').on('click', function(){
        showChat();
    });
};


function showChat(){
    //关闭所有层
    layer.closeAll();

    //页面一打开就执行，放入ready是为了layer所需配件（css、扩展模块）加载完毕
    layer.ready(function(){
        //官网欢迎页
        layer.open({
            type: 2,
            title: '会话',
            fix: false,
            resize:false,
            shade:0,
            offset: 'rb',
            maxmin: false,
            shadeClose: false,
            area: ['600px', '480px'],
            content: [imPageUrl,'no'],
            end: function(){

            }
        });
    });
}
